import Vue from "vue";
import App from "./App";
import Home from "./components/Home.vue";
import WikiPage from "./components/WikiPage.vue";
import VueRouter from "vue-router";
import VueResource from "vue-resource";

require('bootstrap');
// 注册组件
Vue.use(VueResource);
Vue.use(VueRouter);

// 路由
const routes = [{
  path: '/:wikiId/page-home',
  alias: '/:wikiId',
  component: Home
}, {
  path: '/:wikiId/page-:id',
  component: WikiPage
}, {
  path: '/:wikiId/page-:id',
  redirect: '/:wikiId/page-home'
}, {
  path: '/',
  redirect: '/default/page-home'
}];

const router = new VueRouter({
  routes // （缩写）相当于 routes: routes
});


const currentPage = {};

const app = new Vue({
  router,
  components: {
    app: App
  }

}).$mount('#app');
// router.start(App, '#app');
